package org.millioncall.yueyoga.admin.dao.impl;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginateParams;
import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.openplatform.common.StartLimitPairImpl;
import org.millioncall.openplatform.dao.PreparedQuery;
import org.millioncall.yueyoga.admin.dao.BaseDao;
import org.millioncall.yueyoga.admin.dao.CardReportsDAO;
import org.millioncall.yueyoga.admin.model.CardReports;
import org.millioncall.yueyoga.admin.model.ChargerReport;
import org.millioncall.yueyoga.admin.model.HallName;
import org.millioncall.yueyoga.admin.model.MonthReport;
import org.millioncall.yueyoga.admin.model.PayModel;

public class CardReportsDAOImpl extends BaseDao implements CardReportsDAO {

	@Override
	public PaginatedList<CardReports> findCardCounts(int pageNo,int pageSize, Map<String, Object> map) {
		PreparedQuery<CardReports> pq = this.getPagableSqlSessionTemplate().findAll(
				"findCardCounts", map);
		PaginatedList<CardReports> pl = pq.list(new PaginateParams(
				new StartLimitPairImpl(pageNo, pageSize)));
		return pl;
	}

	@Override
	public List<CardReports> findCardCounts(Map<String, Object> map) {
		return this.getPagableSqlSessionTemplate().selectList("findCardCounts",map);
	}

	@Override
	public HallName hallName(String hall) {
		return this.getPagableSqlSessionTemplate().selectOne("hallName",hall);
	}

	@Override
	public List<ChargerReport> findChargerReport(Map<String, Object> map) {
		PreparedQuery<ChargerReport> pq = this.getPagableSqlSessionTemplate().findAll("findChargerReport", map);
		return pq.list();
	}

	@Override
	public List<MonthReport> findMonthReports(Map<String, Object> map) {
		return this.getPagableSqlSessionTemplate().selectList("findMonthReports",map);
	}

	@Override
	public List<PayModel> findrecharges(Map<String, Object> map) {
		// TODO Auto-generated method stub
		 return this.getPagableSqlSessionTemplate().selectList("findrecharges",map);
	}
	
}
